package com.gather.orm;

import java.util.Objects;

/**
 * 新浪微博注册类
 */
public class User {
    private String name;
    private String pwd;
    private String password;
    private String email;
    private String phone;
    private String birthday;

    public User(String name, String pwd, String password, String email, String phone, String birthday) {
        this.name = name;
        this.pwd = pwd;
        this.password = password;
        this.email = email;
        this.phone = phone;
        this.birthday = birthday;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(name, user.name);
    }

    @Override
    public int hashCode() {
        // 以用户名作为判断依据
        return name.hashCode();
    }
}
